package com.zeltov.api;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.beanutils.BeanUtils;

import com.zeltov.bo.Car;
import com.zeltov.dao.CarDAO;
import com.zeltov.dao.CarDaoJPA;

public class CarServiceBasic extends CarService {
	
	private CarDAO carDao = null;
	/* (non-Javadoc)
	 * @see com.zeltov.api.CarService#getAllCars()
	 */
	public List<CarTO> getAllCars() {
		
		carDao = new CarDaoJPA();
		List<Car> allCarEOs = carDao.getAllCars();
		ArrayList<CarTO> carDtoList = new ArrayList<CarTO>();
		for (Car carEO : allCarEOs) {
			CarTO carDTO = new CarTO();
			copyProperties(carEO, carDTO);
			carDtoList.add(carDTO);
		}
		return carDtoList;
	}


}
